<include file="./Application/Admin/View/head.html" />

<!--<script type="text/javascript" language="javascript" src="__PUBLIC__/admin/js/eye-base.js"></script>-->
<!--<script type="text/javascript" language="javascript" src="__PUBLIC__/admin/js/eye-all.js"></script>-->
<!--<link href="__PUBLIC__/css/foundation.min.css" rel="stylesheet" type="text/css">-->
<link href="__PUBLIC__/css/foundation-datepicker.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/foundation-datepicker.js"></script>
<script src="__PUBLIC__/js/foundation-datepicker.zh-CN.js"></script>
<body>
<form action="?">
    <p class="yonghusousuo">
        用户名：<input class="tet" name="user_name" type="text" placeholder="请输入用户名..." value="{$user_name}">&nbsp;&nbsp;
        订单号：<input class="tet" name="order_sn" type="text" placeholder="请输入订单号..." value="{$order_sn}">&nbsp;&nbsp;
        订单状态：<select id="provinces" name="type" class="SelectList1" >
        <option value="0">请选择</option>
            <option value="1" <if condition="$type eq 1" >selected="selected" </if>/>待发货</option>
            <option value="2" <if condition="$type eq 2" >selected="selected" </if>/>已发货</option>
            <option value="3" <if condition="$type eq 3" >selected="selected" </if>/>待评价</option>
            <option value="4" <if condition="$type eq 4" >selected="selected" </if>/>已完成</option>
        </select>&nbsp;&nbsp;
        添加时间：<input type="text" name="start_time" value="{$start_time}" style="width: 150px;padding-left: 10px;box-sizing: border-box;" class="demo-2"/>
        结束时间：<input type="text" name="end_time" value="{$end_time}" style="width: 150px;padding-left: 10px;box-sizing: border-box;" class="demo-2"/>
        <input type="submit" class="sub" value="搜 索">
    </p><br/>
</form>
<style>
    .yonghusousuo input{width:200px; border-radius: 5px;}
</style>
<span class="head_span">
    <a href="__MODULE__/Order/index" class="tiaojia">查看课程订单</a>
    <a href="__MODULE__/Order/goods_list" class="tiaojia">查看商品订单</a>
    <a href="__MODULE__/Order/recharge" class="tiaojia">查看充值记录</a>
</span>
<style>
    .head_span{margin-left: -200px; width: 600px; display: block; text-align: center; margin: 10px auto 0 auto;overflow: hidden;}
    .head_span a {padding: 5px 30px;    }
</style>
总成交量：{$sum['sum(total_price)']}
<ul class="chakankc_top chakandingdan">
    <li>购买人</li>
    <li>订单号<span class="xiantiao"></span></li>
    <li>商品<span class="xiantiao"></span></li>
    <li>成交时间<span class="xiantiao"></span></li>
    <li>成交金额<span class="xiantiao"></span></li>
    <li>快递单号<span class="xiantiao"></span></li>
    <li>支付方式<span class="xiantiao"></span></li>
    <li>订单状态<span class="xiantiao"></span></li>
    <li>操作<span class="xiantiao"></span></li>
</ul>
<ul class="chakankc chakandingdan_in">
    <foreach name="list" item="v">
    <li class="chakankc_in">
        <span class="sp01">{$v['nickname']} | {$v['full_name']}</span>
        <span class="sp02">{$v['order_sn']}&nbsp;<span class="xiantiao"></span></span>
        <if condition="empty($v['goods_name'])">
            <span class="sp02" title="{$v['curr_name']}">{$v['curr_name']}&nbsp;<span class="xiantiao"></span></span>
        <else />
            <span class="sp02" title="{$v['goods_name']}">{$v['goods_name']}&nbsp;<span class="xiantiao"></span></span>
        </if>
        <span class="sp04">{$v['add_time']|date="Y-m-d H:i",###}<span class="xiantiao"></span></span>
        <span class="sp04">{$v['total_price']}<span class="xiantiao"></span></span>
        <span class="sp04">{$v['express_sn']|default='空'}<span class="xiantiao"></span></span>
        <if condition="$v['pay_type'] == 2">
            <span class="sp05">微信支付<span class="xiantiao"></span></span>
        <else />
            <span class="sp05">福币支付<span class="xiantiao"></span></span>
        </if>
        <if condition="$v['type'] == 0">
            <span class="sp05">未付款<span class="xiantiao"></span></span>
        <elseif condition="$v['type'] == 1" />
            <span class="sp05">待发货<span class="xiantiao"></span></span>
        <elseif condition="$v['type'] == 2" />
            <span class="sp05">已发货<span class="xiantiao"></span></span>
        <elseif condition="$v['type'] == 3" />
            <span class="sp05">待评论<span class="xiantiao"></span></span>
        <elseif condition="$v['type'] == 4" />
            <span class="sp05">已完成<span class="xiantiao"></span></span>
        </if>
        <span class="sp05"><a href="__MODULE__/Order/goods_info/id/{$v['buy_id']}">详情</a><span class="xiantiao"></span></span>

    </li>
    </foreach>
</ul>

<div class="page">
    {$show}
    <b style="margin-left: 5px;">共{$count}条记录</b>
    <a href="__MODULE__/Order/p/?user_name={$user_name}&order_sn={$order_sn}&start_time={$start_time}&end_time={$end_time}&type={$type}" >打印</a>
</div>
<style>
    .page{ width: 400px; float: right; margin-top: 20px;}
    .page span{display: block; background: #fff; width: 20px; float: left;margin-left:2px;text-align: center;}
    .page a{display: block; background: #5BC0DE; width: 40px; float: left; margin-left:2px; text-align: center; }
    .chakankc .chakankc_in span{text-overflow: ellipsis; overflow: hidden; display: -webkit-box;  -webkit-line-clamp: 1;  -webkit-box-orient: vertical;}
    .chakandingdan li{width:11.1%;}
    .chakandingdan_in .chakankc_in span{width:11.1%;}
</style>
<script>

    $('.demo-2').fdatepicker({
        format: 'yyyy-mm-dd hh:ii',
        pickTime: true
    });


    var nowTemp = new Date();
    var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
    var checkin = $('#dpd1').fdatepicker({
        onRender: function (date) {
            return date.valueOf() < now.valueOf() ? 'disabled' : '';
        }
    }).on('changeDate', function (ev) {
        if (ev.date.valueOf() > checkout.date.valueOf()) {
            var newDate = new Date(ev.date)
            newDate.setDate(newDate.getDate() + 1);
            checkout.update(newDate);
        }
        checkin.hide();
        $('#dpd2')[0].focus();
    }).data('datepicker');
    var checkout = $('#dpd2').fdatepicker({
        onRender: function (date) {
            return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
        }
    }).on('changeDate', function (ev) {
        checkout.hide();
    }).data('datepicker');
</script>
</body>
</html>